#include("/manage/_common/_layout.html")
#@layout()

### ********************************* 定义页面标题
#define title()
编辑主题
#end

### ********************************* css导入
#define import_css()
<style type="text/css" media="screen">
#ID_editor {
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: 0;
	position: absolute;
	font-size: 14px;
}
.layui-row{background-color: #ebebeb;}
.layui-card-header{background-color: #ebebeb;}
.layui-card-body{background-color: #ebebeb; padding: 3px 5px; height:530px;}
</style>
#end

### ********************************* js导入
#define import_js()
#include("/manage/_common/_import_ace.html")
#include("/manage/_common/_import_cookie.html")
#end

### ********************************* Body内容区开始
#define main()
<div class="layui-row layui-col-space5">
	<div class="layui-col-xs12 layui-col-sm8 layui-col-md9">
		<div class="layui-card">
			<div class="layui-card-header">
				<form class="layui-form">
				<div class="layui-btn-group">
					<a onclick="active.newFile();" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon layui-icon-add-circle-fine"></i>新建文件</a>
					<a onclick="active.newDir();" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon layui-icon-add-circle-fine"></i>新建文件夹</a>
				</div>
				<div class="layui-inline">
					<select lay-filter="ace-theme">
						<option value="ace/theme/eclipse" selected="selected">Eclipse</option>
						<optgroup label="Bright">
							<option value="ace/theme/chrome">Chrome</option>
							<option value="ace/theme/clouds">Clouds</option>
							<option value="ace/theme/crimson_editor">Crimson Editor</option>
							<option value="ace/theme/dawn">Dawn</option>
							<option value="ace/theme/dreamweaver">Dreamweaver</option>
							<option value="ace/theme/eclipse">Eclipse</option>
							<option value="ace/theme/github">GitHub</option>
							<option value="ace/theme/iplastic">IPlastic</option>
							<option value="ace/theme/solarized_light">Solarized Light</option>
							<option value="ace/theme/textmate">TextMate</option>
							<option value="ace/theme/tomorrow">Tomorrow</option>
							<option value="ace/theme/xcode">XCode</option>
							<option value="ace/theme/kuroir">Kuroir</option>
							<option value="ace/theme/katzenmilch">KatzenMilch</option>
							<option value="ace/theme/sqlserver">SQL Server</option>
						</optgroup>
						<optgroup label="Dark">
							<option value="ace/theme/ambiance">Ambiance</option>
							<option value="ace/theme/chaos">Chaos</option>
							<option value="ace/theme/clouds_midnight">Clouds Midnight</option>
							<option value="ace/theme/dracula">Dracula</option>
							<option value="ace/theme/cobalt">Cobalt</option>
							<option value="ace/theme/gruvbox">Gruvbox</option>
							<option value="ace/theme/gob">Green on Black</option>
							<option value="ace/theme/idle_fingers">idle Fingers</option>
							<option value="ace/theme/kr_theme">krTheme</option>
							<option value="ace/theme/merbivore">Merbivore</option>
							<option value="ace/theme/merbivore_soft">Merbivore Soft</option>
							<option value="ace/theme/mono_industrial">Mono Industrial</option>
							<option value="ace/theme/monokai">Monokai</option>
							<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
							<option value="ace/theme/solarized_dark">Solarized Dark</option>
							<option value="ace/theme/terminal">Terminal</option>
							<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
							<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
							<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
							<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
							<option value="ace/theme/twilight">Twilight</option>
							<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
						</optgroup>
					</select>
				</div>
				<div class="layui-btn-group" style="float: right">
					<a onclick="active.saveFile();" class="layui-btn layui-btn-sm #if(!file)layui-btn-disabled#end" #if(!file)disabled#end><i class="layui-icon layui-icon-ok"></i>保存</a>
				</div>
				</form>
			</div>
			<div class="layui-card-body">
				<div id="ID_editor">
				#if(!file)

					<fieldset class="layui-elem-field layui-field-title">
						<legend><blockquote class="layui-elem-quote">没有可编辑的文件</blockquote></legend>
					</fieldset>
				#end
				</div>
			</div>
		</div>
	</div>
	<div class="layui-hide-xs layui-col-sm4 layui-col-md3">
		<div class="layui-card">
			<div class="layui-card-header layui-elip">
				<span title="#(dir)">#(dir)</span>
			</div>
			<div class="layui-card-body" style="overflow: scroll;">
				<table class="layui-table">
					<tbody>
					#if(parentDir)
						<tr><td><a style="color: blue" href="#(ctx)/manage/theme/edit?dir=#(parentDir)">[ .. ]</a></td></tr>
					#end
					#for(f : fileList)
						#if(f.isDir())
						<tr>
							<td>
								<a style="color: blue" href="#(ctx)/manage/theme/edit?dir=#(dir)#if(dir!='/')/#end#(f.name)">[ #(f.name) ]</a>
								<button onclick="active.delDir('#(f.name)');" class="layui-btn layui-btn-sm layui-btn-danger" style="float: right"><i class="layui-icon layui-icon-delete"></i></button>
							</td>
						</tr>
						#end
					#end
					#for(f : fileList)
						#if(!f.isDir())
						<tr>
							<td>
								<a href="#(ctx)/manage/theme/edit?dir=#(dir)&file=#(f.name)">#if(f.name==file)<span style="color: red;">>> #(f.name)</span>#else#(f.name)#end</a>
								<button onclick="active.delFile('#(f.name)');" class="layui-btn layui-btn-sm layui-btn-danger" style="float: right"><i class="layui-icon layui-icon-delete"></i></button>
							</td>
						</tr>
						#end
					#end
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
#end
### ********************************* Body内容区结束


### ********************************* 脚本区开始
#define script()
#include("_index_script.html")
#end
### ********************************* JS脚本区结束
